<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var f1 = function(x){
            return x+10;
        }
        console.log(f1(10))//20
        function f2 (){
            return 10;
        }
        console.log(f2())//10
        //箭头函数
        var f3 =(x,y)=>{
            return x+y;
        }
        console.log(f3(10,20))//30
        var f4 =(x,y)=>x+y;
        console.log(f4(10,20))//30

        var f5 =()=>({name:"百里川",age:18});
        console.log(f5())//{name:"百里川",age:18}

        var user ={
            name:"李星云",
            age:19,
            say:function(){
                console.log(this.name)
            }
        }
        console.log(user.say())

    </script>
    
</body>
</html>